package com.itheima.mytest;

import java.io.*;

public class BufferedStreamDemo1 {
    public static void main(String[] args) throws IOException {
        //利用字节流进行文件的拷贝
        BufferedInputStream fis = new BufferedInputStream(new FileInputStream("myio\\a.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("myio\\copy.txt"));
        int ch;
        while ((ch = fis.read()) != -1) {
            bos.write(ch);
        }
        bos.close();
        fis.close();
    }
}
